import 'package:jyofservice/bean/work_notice_detail_entity.dart';
import 'package:jyofservice/generated/json/base/json_filed.dart';

workNoticeDetailEntityFromJson(WorkNoticeDetailEntity data, Map<String, dynamic> json) {
	if (json['Code'] != null) {
		data.code = json['Code'].toString();
	}
	if (json['Msg'] != null) {
		data.msg = json['Msg'].toString();
	}
	if (json['Data'] != null) {
		data.data = WorkNoticeDetailData().fromJson(json['Data']);
	}
	return data;
}

Map<String, dynamic> workNoticeDetailEntityToJson(WorkNoticeDetailEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['Code'] = entity.code;
	data['Msg'] = entity.msg;
	data['Data'] = entity.data?.toJson();
	return data;
}

workNoticeDetailDataFromJson(WorkNoticeDetailData data, Map<String, dynamic> json) {
	if (json['A'] != null) {
		data.a = WorkNoticeDetailDataA().fromJson(json['A']);
	}
	if (json['B'] != null) {
		data.b = (json['B'] as List).map((v) => WorkNoticeDetailDataB().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> workNoticeDetailDataToJson(WorkNoticeDetailData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['A'] = entity.a?.toJson();
	data['B'] =  entity.b?.map((v) => v!.toJson())?.toList();
	return data;
}

workNoticeDetailDataAFromJson(WorkNoticeDetailDataA data, Map<String, dynamic> json) {
	if (json['ID'] != null) {
		data.iD = json['ID'] is String
				? int.tryParse(json['ID'])
				: json['ID'].toInt();
	}
	if (json['Title'] != null) {
		data.title = json['Title'].toString();
	}
	if (json['Type'] != null) {
		data.type = json['Type'] is String
				? int.tryParse(json['Type'])
				: json['Type'].toInt();
	}
	if (json['BeginDt'] != null) {
		data.beginDt = json['BeginDt'];
	}
	if (json['EndDt'] != null) {
		data.endDt = json['EndDt'];
	}
	if (json['NeiRong'] != null) {
		data.neiRong = json['NeiRong'].toString();
	}
	if (json['State'] != null) {
		data.state = json['State'] is String
				? int.tryParse(json['State'])
				: json['State'].toInt();
	}
	if (json['Flag'] != null) {
		data.flag = json['Flag'] is String
				? int.tryParse(json['Flag'])
				: json['Flag'].toInt();
	}
	if (json['CreateDate'] != null) {
		data.createDate = json['CreateDate'].toString();
	}
	if (json['CreateUserId'] != null) {
		data.createUserId = json['CreateUserId'] is String
				? int.tryParse(json['CreateUserId'])
				: json['CreateUserId'].toInt();
	}
	if (json['UpdateDate'] != null) {
		data.updateDate = json['UpdateDate'];
	}
	if (json['UpdateUserId'] != null) {
		data.updateUserId = json['UpdateUserId'];
	}
	if (json['LJStopTime'] != null) {
		data.lJStopTime = json['LJStopTime'].toString();
	}
	if (json['Fee'] != null) {
		data.fee = json['Fee'].toString();
	}
	if (json['RowIndex'] != null) {
		data.rowIndex = json['RowIndex'] is String
				? int.tryParse(json['RowIndex'])
				: json['RowIndex'].toInt();
	}
	return data;
}

Map<String, dynamic> workNoticeDetailDataAToJson(WorkNoticeDetailDataA entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['ID'] = entity.iD;
	data['Title'] = entity.title;
	data['Type'] = entity.type;
	data['BeginDt'] = entity.beginDt;
	data['EndDt'] = entity.endDt;
	data['NeiRong'] = entity.neiRong;
	data['State'] = entity.state;
	data['Flag'] = entity.flag;
	data['CreateDate'] = entity.createDate;
	data['CreateUserId'] = entity.createUserId;
	data['UpdateDate'] = entity.updateDate;
	data['UpdateUserId'] = entity.updateUserId;
	data['LJStopTime'] = entity.lJStopTime;
	data['Fee'] = entity.fee;
	data['RowIndex'] = entity.rowIndex;
	return data;
}

workNoticeDetailDataBFromJson(WorkNoticeDetailDataB data, Map<String, dynamic> json) {
	if (json['ID'] != null) {
		data.iD = json['ID'] is String
				? int.tryParse(json['ID'])
				: json['ID'].toInt();
	}
	if (json['WorkID'] != null) {
		data.workID = json['WorkID'] is String
				? int.tryParse(json['WorkID'])
				: json['WorkID'].toInt();
	}
	if (json['LevelID'] != null) {
		data.levelID = json['LevelID'] is String
				? int.tryParse(json['LevelID'])
				: json['LevelID'].toInt();
	}
	if (json['Lev'] != null) {
		data.lev = json['Lev'].toString();
	}
	return data;
}

Map<String, dynamic> workNoticeDetailDataBToJson(WorkNoticeDetailDataB entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['ID'] = entity.iD;
	data['WorkID'] = entity.workID;
	data['LevelID'] = entity.levelID;
	data['Lev'] = entity.lev;
	return data;
}